<template>
  <div>
    <top-label v-model="index">
      <span :slot="0">专家数据管理</span>
      <span :slot="1">救援队伍管理</span>
      <span :slot="2">救援物资</span>
      <span :slot="3">备品备件</span>
    </top-label>
    <el-card class="content">
      <expert-data-management v-if="index === 0"></expert-data-management>
      <rescue-team-management v-if="index === 1"></rescue-team-management>
      <rescue-material-management
        v-if="index === 2"
      ></rescue-material-management>
      <sensor-accessories v-if="index === 3"></sensor-accessories>
    </el-card>
  </div>
</template>

<script>
import RescueMaterialManagement from "./rescue-support/RescueMaterialManagement";
import RescueTeamManagement from "./rescue-support/RescueTeamManagement";
import ExpertDataManagement from "./rescue-support/ExpertDataManagement";
import SensorAccessories from "./rescue-support/SensorAccessories";
import TopLabel from "../../components/TopLabel";
export default {
  name: "RescueSupport",
  components: {
    RescueMaterialManagement,
    RescueTeamManagement,
    ExpertDataManagement,
    SensorAccessories,
    TopLabel,
  },
  data() {
    return {
      index: 0,
    };
  },
  created() {
    if (window.sessionStorage.getItem("indexsu2") != null) {
      this.index = Number(window.sessionStorage.getItem("indexsu2"));
    }
  },
  watch: {
    index: function (indexra, oldVal) {
      window.sessionStorage.setItem("indexsu2", indexra);
      // console.log(val);
    },
  },
};
</script>

<style scoped>
.row {
  margin-left: 0.08rem;
}
.content {
  margin-left: 0.08rem;
  font-size: 0.07rem;
  height: 85vh;
}
</style>